package edu.zut.main.thread;

public class CreateThreadDemo01 {
    /**
     * 创建线程的第一个方法：继承Thread类class testThread extends Thread
     * 然后实例化对象，运行tt.start();
     * @param args
     */
    public static void main(String[] args) {
        //主线程
        for (int i = 1; i <=5; i++) {
            System.out.println(Thread.currentThread().getName()+i);
        }
        //子线程1
        testThread tt = new testThread("小郭");
        tt.start();
        //zhu
        for (int i = 1; i <= 5; i++) {
            System.out.println(Thread.currentThread().getName()+i);
        }
    }
}
class testThread extends Thread{
    public testThread(String name) {
        super(name);
    }

    @Override
    public void run(){
        for (int i =1; i <= 5; i++) {
            System.out.println(Thread.currentThread().getName()+i);
        }
    }
}
